﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace ExamServer.Entities
{
    /// <summary>
    /// 用户实体
    /// </summary>
    public class Users
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [Display(Name = "主键")]
        public Guid Id { get; set; }

        [Required]
        [Display(Name = "用户名")]
        [MaxLength(20)]
        public string Name { get; set; }

        [Required]
        [Display(Name = "用户密码")]
        [MaxLength(20)]
        //[StringLength(12,MinimumLength =6,ErrorMessage ="密码必须在6~12位之间")]
        public string Password { get; set; }

        [Display(Name = "生日")] //1988-01-01
        public string Birthday { get; set; }

        [Display(Name ="电子邮件")]
        [EmailAddress]
        public string Email { get; set; }

        [Display(Name ="备注")]
        public string Remark { get; set; }

        public virtual IList<tbUsersAndRoles> UserRoles{get;set;}
    }
}
